package cn.mazexal.examapi.utils.qiniu;

import cn.hutool.core.io.FileUtil;
import cn.mazexal.examapi.utils.DateUtils;
import cn.mazexal.examapi.utils.MD5Utils;
import com.qiniu.http.Response;
import com.qiniu.storage.UploadManager;
import com.qiniu.util.Auth;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * 七牛云存储
 *
 * @author: Mazexal
 * Date: 2025/6/8
 */
@Component
public class QiniuOssUtil {

    @Resource
    private UploadManager uploadManager;
    @Resource
    private Auth auth;
    @Value("${qiniu.bucket}")
    private String bucket;
    @Value("${qiniu.domain}")
    private String domain;

    @Value("${qiniu.accessKey}")
    private String accessKey;


    public String getToken() {
        return auth.uploadToken(bucket, null, 3600, null);
    }

}
